package com.cq.hd;

import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.cq.hd.generator.config.MyDataSourceConfig;
import com.cq.hd.generator.config.MyGlobalConfig;
import com.cq.hd.generator.config.MyPackageConfig;
import com.cq.hd.generator.config.MyStrategyConfig;
import com.cq.hd.generator.config.*;

/**
 * @description: 代码生成器
 * @author: mYunYu
 *  2021/7/7 15:11
 * @version: v1.0
 */
public class MybatisPlusGenerator {

    public static void main(String[] args) {
        AutoGenerator autoGenerator = new AutoGenerator();

        autoGenerator.setTemplateEngine(new FreemarkerTemplateEngine());

        autoGenerator.setGlobalConfig(new MyGlobalConfig().getGlobalConfig());

        autoGenerator.setDataSource(new MyDataSourceConfig().getDataSourceConfig());

        autoGenerator.setStrategy(new MyStrategyConfig().getStrategyConfig());

        autoGenerator.setPackageInfo(new MyPackageConfig().getPackageConfig());

        autoGenerator.execute();
        System.out.println("代码生成成功 -----------------> ok");
    }

}
